GameBricks · for teachers & parents
What each example teaches, and what to say when a kid is stuck. Ages 9–14, no games experience needed.
pip install -e .
python -m gamebricks
EXAMPLE
PYTHON IT INTRODUCES
MATHS & THINKING
01_my_first_game
walk to two coins
Giving a command with settings — coin(across=3, up=5). These are keyword arguments, real Python they keep forever.
Coordinates on two axes. Counting from 0 — genuinely hard at nine. Turn on show_grid() and let them count with a finger.
02_catch
falling stars
A loop (@every(1)), a rule (@when_touch), a function with a parameter, and score += 1.
Rates — one star per second. Speed as a number you feel. Modulo arrives naturally as "every 5th star".
03_chase
dodge the ghosts
Writing two rules side by side — one for ghosts, one for hearts — and asking an object to act: hero.say("ouch").
Balance. Tune hearts() and ghost speed until it's hard but fair. That is hypothesis testing.
04_maze
a maze they draw
Multi-line strings, and the idea that text can be data — the picture between the quotes IS the level.
A 2D grid: rows and columns. Then the real question — is every coin actually reachable? They must test it.
05_platformer
jump to the flag
Settings that interact: jump_power(3) against the height of every platform. One number changes everything.
Estimation and iteration. Put the flag out of reach and nothing errors — they play, find it impossible, and redesign.
06_keys_and_doors
locked door, 2 levels
Several things in one call — levels(a, b) — and state that persists: the keys you're carrying.
Dependency and sequence. B needs A first. The first real taste of designing a puzzle rather than a playground.
07_remix_a_builtin
change a finished game
Importing a module and reading code someone else wrote — gamebricks.load("platformer"), then editing it.
Abstraction. Noticing that all five games are the same six bricks, so a trick learned in one works in all of them.
A 40-MINUTE SESSION
05′  Play a ready-made game. Don't open the file yet.
10′  Change three numbers. Predict out loud first, then run.
10′  Draw their own level picture.
10′  Make it fair — tune hearts, speed, jump power.
05′  Swap seats and play each other's game.
WHEN THEY'RE STUCK, SAY THIS
“Run it and show me what happens.”
“What did you expect? What happened instead?”
“Read the message out loud — it tells you the fix.”
“Change one number and run it again.”
Don't fix their file for them. Ask them to describe the square they want, and let them find the numbers.
YOU'LL KNOW IT LANDED WHEN
They predict the result before running. They fix an unreachable flag without help. They change hearts() so a younger sibling can win. They ask for something the package can't do yet — that's the moment to go looking together.
WHAT THIS DOESN'T TEACH
Writing their own classes, files, algorithms, recursion, testing, version control. This is the on-ramp. The step out is a kid outgrowing hearts() and writing their own spawn logic with free_square().
WHILE PLAYING: R RESTART · P PAUSE · G GRID · M MUTE · ESC QUIT GAMEBRICKS · TEACHER SHEET